package cn.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * AI搜题对话消息实体类
 * 
 * @author zhentao
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tutor_messages")
public class TutorMessage {

    public static final String MESSAGE_TYPE_USER = "USER";
    public static final String MESSAGE_TYPE_AI = "AI";
    public static final String CONTENT_TYPE_TEXT = "TEXT";
    public static final String CONTENT_TYPE_IMAGE = "IMAGE";

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 所属会话ID
     */
    private Long sessionId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 消息类型
     */
    private String messageType;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 内容类型
     */
    private String contentType;

    /**
     * 父消息ID
     */
    private Long parentMessageId;

    /**
     * 语音文件URL(存储在MinIO中)
     */
    private String voiceFileUrl;

    /**
     * 语音文件名(MinIO中的对象名)
     */
    private String voiceFileName;

    /**
     * 语音时长(秒)
     */
    private Integer voiceDuration;

    /**
     * 消息元数据
     */
    private String metadata;

    /**
     * 是否已删除
     */
    private Boolean isDeleted;

    /**
     * 创建时间
     */
    private LocalDateTime createdTime;

    /**
     * 更新时间
     */
    private LocalDateTime updatedTime;
}
